]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
fix manual placement for RTL locales
authorAbderrahim Kitouni <a.kitouni@gmail.com>
Fri, 25 Dec 2009 11:27:09 +0000 (12:27 +0100)
committerDan Winship <danw@gnome.org>
Thu, 25 Feb 2010 19:45:07 +0000 (14:45 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=584662

js/ui/overview.js

index 4db84d1f48e5f8d2e7e3476fee9a5762116bd40b..1f2ca9bf29d7602081983eab6523cfec11798204 100644 (file)
@@ -308,6 +308,7 @@ Overview.prototype = {
 
     relayout: function () {
         let primary = global.get_primary_monitor();
+        let rtl = (St.Widget.get_default_direction () == St.TextDirection.RTL);
 
         this._recalculateGridSizes();
 
@@ -329,10 +330,19 @@ Overview.prototype = {
         this._workspacesHeight = Math.floor(displayGridRowHeight * workspaceRowsUsed
                                    - WORKSPACE_GRID_PADDING * (primary.height / primary.width) * 2);
 
-        this._workspacesX = displayGridColumnWidth + WORKSPACE_GRID_PADDING;
+        if (rtl) {
+            this._workspacesX = WORKSPACE_GRID_PADDING;
+        } else {
+            this._workspacesX = displayGridColumnWidth + WORKSPACE_GRID_PADDING;
+        }
         this._workspacesY = Math.floor(displayGridRowHeight + WORKSPACE_GRID_PADDING * (primary.height / primary.width));
 
-        this._dash.actor.set_position(0, contentY);
+        if (rtl) {
+            this._dash.actor.set_position(primary.width - displayGridColumnWidth, contentY);
+        } else {
+            this._dash.actor.set_position(0, contentY);
+        }
+
         this._dash.actor.set_size(displayGridColumnWidth, contentHeight);
         this._dash.searchArea.height = this._workspacesY - contentY;
         this._dash.sectionArea.height = this._workspacesHeight;
@@ -356,6 +366,11 @@ Overview.prototype = {
                                          this._workspacesY);
         // Dynamic width
         this._paneContainer.height = this._workspacesHeight;
+        if (rtl) {
+            this._paneContainer.connect('notify::width', Lang.bind(this, function (paneContainer) {
+                paneContainer.x = this._dash.actor.x - (DEFAULT_PADDING + paneContainer.width);
+            }));
+        }
 
         this._transparentBackground.set_position(this._paneContainer.x, this._paneContainer.y);
         this._transparentBackground.set_size(primary.width - this._paneContainer.x,